<?php require_once("index.php")?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript" type="text/javascript">
var nav_index=<?=$nav_index?>,sub_index=<?=$sub_index?>;
</script>
<?php $this->load->view("inc/header")?>
<script language="JavaScript" type="text/javascript">
(function($){
$(function(){
	$("input[rel=index]").focus(function(){
		$(this).select();
	}).change(function(){
		var id=parseInt($(this).attr("id").substring(5)),val=$(this).attr("value");
		$(this).parent().find("img,font").remove();
		$(this).parent().append("<img src='a/loading.gif' style='width:16px;height:16px;' align='absmiddle' />");
		$.getJSON("admin_menu.php?jsChangeIndex/"+id+"/"+val,function(json){
			var o=$("#index"+json.id).parent();
			o.find("font,img").remove();
			if(json.result==0){
				o.append("<font color='green'><b>√</b></font>")
			}else{
				o.append("<font color='red'><b>Ｘ</b></font>")
			}
			//window.location.href='news.php';
			window.location.history.back();
		});
		return;
	});
});
})(jQuery);
</script>
</head>
<body>
<div id="wrap">
<?=$this->load->view("inc/navi")?>
<div id="container">
<div id="side">
<?=$this->load->view("inc/side")?>
</div>
<!-- end side -->


<div id="wrapin">
<div id="main">


<?=form_open("$title/access")?>
<div class="box">
<b class="b1"></b><b class="b2"></b><b class="b3"></b>  
<div class="bdiv">
	<div class="btop">
		<h2><a href="<?=site_url("$title/index")?>"><?=$caption?></a><em><?=$total?>个符合&nbsp;&nbsp;<a href="<?=site_url("$title/create")?>" rel="ajax"><img src="a/i-add.gif" align="absmiddle" />添加</a></em></h2>
		<p>该功能仅供开发人员使用，请勿更改以免影响网站后台使用</p>
	</div>
	<div class="bmain">  
<table class="datable" border="0" cellpadding="0" cellspacing="0" height="100%">
	<thead>
		<tr>
            <th>排序</th>
			<th>ID</th>
			<th>标题</th>
			<th>前台链接</th>
            <th>所属模块</th>
			<th>链接目标</th>
			<th>Ajax</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach($data as $r){?>
		<tr rel="<?=$r->id?>" value="">
            <td><?php if($r->is_fixed!=1){ ?><input rel="index" id="index<?=$r->id;?>" type="text" value="<?=$r->order_id;?>" onmouseover="this.focus()" onfocus="this.select()" style="width:35px;" title="即时更改,越小越靠前" class="text tip" /><?php }?></td>
			<td><?=$r->id?></td>
			<td><?php 
				if($r->depth>0){
					$r->title=str_repeat('&nbsp;&nbsp;&nbsp;',$r->depth-1).'&nbsp;&nbsp;&nbsp;|-&nbsp;'.$r->title;
				}else{
					$r->title="<b>$r->title</b>";
				}
				echo $r->title."&nbsp;&nbsp;";
				echo $r->title_en;
				?></td>
			<td><?=$r->fronturl?></td>
			<td><?php
            		switch ($r->url){
					case 'single';
						echo '单页';
						break;
					case 'news';
						echo '新闻';
						break;
					case 'product';
						echo '产品';
						break;
					case 'article';
						echo '文章';
						break;
					case 'picture';
						echo '图片';
						break;
					case 'download';
						echo '下载';
						break;
					case 'honor';
						echo '资质荣誉';
						break;
					case 'history';
						echo '发展历程';
						break;
					case 'ebook';
						echo '电子期刊';
						break;
					case 'video';
						echo '影视传媒';
						break;
					case 'feedback';
						echo '在线留言';
						break;
					case 'recruit';
						echo '招聘岗位';
						break;
					case 'recruit_apply';
						echo '应聘列表';
						break;
					case 'friend_link';
						echo '友情链接';
						break;
					case 'product_type';
						echo '产品分类';
						break;
					case 'news_type';
						echo '新闻分类';
						break;
					}
				?>
            </td>
			<td><?=$r->targets?></td>
			<td><?=admin_yes_no($r->ajax)?></td>
			<td><?php if($r->is_fixed!=1){ ?><a href="<?=site_url("$title/create/{$r->id}")?>" rel="ajax">添加子类</a> | <a href="<?=site_url("$title/edit/{$r->id}")?>" rel="ajax">编辑</a> | <a rel="delete" href="<?=site_url("$title/delete/{$r->id}")?>">删除</a><?php } ?></td>
		</tr>
	<?php }?>
	</tbody>
</table>
	</div>  
</div>  
<b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>  
</div>
<div class="table-option">
<ul>
	<li><a class="button" rel="check-all"><span>全选</span></a></li>
	<li><a class="button" rel="check-off"><span>不选</span></a></li>
	<li><a class="button" rel="delete-all"><span>删除</span></a></li>
</ul>
<div class="i10"></div>
</div>
<?=form_close()?>


</div>
<!-- end main -->
</div>
<!-- end content -->
</div>
<!-- end container -->
</div><!-- end wrap -->
</body>
</html>